<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>
<%@ taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@ taglib uri="http://richfaces.org/rich" prefix="rich"%>

<rich:panel header="#{messages['currency.rate.create.title']}">
	<h:panelGrid ><h:outputText value="#{errorBean.errorMessage}" styleClass="error"></h:outputText></h:panelGrid>
	
	<t:panelGrid columns="2">
		<h:outputText></h:outputText>
		<h:panelGroup>
		  	<h:outputText value="*" styleClass="standardText_Mandatory" /> 
			<h:outputText value="#{messages['instruction']}" styleClass="standardText_Instruction" />
		</h:panelGroup>
		
		<h:outputText></h:outputText>
		<t:message for="localRate" styleClass="error"></t:message>
	
	    <h:panelGroup>
	    	<h:outputText value="*" styleClass="standardText_Mandatory" />	
		    <h:outputLabel for="localRate" value="#{messages['local.rate.label']}" styleClass="standardText_Label" />
	    </h:panelGroup>
	    <h:panelGroup>
	    	<t:inputText id="localRate" required="true" size="10" maxlength="10" styleClass="standardText" value="#{currencyRateBean.currencyRate.localRate}">
	    		<f:convertNumber pattern="##0.00" type="currency" />
	    	</t:inputText>
	    </h:panelGroup>
	    
	    <h:outputText></h:outputText>
		<t:message for="foreignRate" styleClass="error"></t:message>
	    
		<h:panelGroup>
	    	<h:outputText value="*" styleClass="standardText_Mandatory" />	
		    <h:outputLabel for="foreignRate" value="#{messages['foreign.rate.label']}" styleClass="standardText_Label" />
	    </h:panelGroup>
	    <h:panelGroup>
	    	<t:inputText id="foreignRate" required="true" size="10" maxlength="10" styleClass="standardText" value="#{currencyRateBean.currencyRate.foreignRate}">
	    		<f:convertNumber pattern="##0.00" type="currency" />
	    	</t:inputText>
	    </h:panelGroup>
		
		<h:outputLabel for="effectiveDate" value="#{messages['effective.date.label']}" styleClass="standardText_Label" />
		<rich:calendar id="effectiveDate" popup="true" showInput="true" datePattern="dd/MM/yyyy" value="#{currencyRateBean.currencyRate.effectiveDate}" ></rich:calendar>
		
		<h:outputLabel for="expiryDate" value="#{messages['expiry.date.label']}" styleClass="standardText_Label" />
		<rich:calendar id="expiryDate" popup="true" showInput="true" datePattern="dd/MM/yyyy" value="#{currencyRateBean.currencyRate.expiryDate}" ></rich:calendar>
		
		<h:panelGroup></h:panelGroup>
		<h:panelGroup></h:panelGroup>
		
		<h:panelGroup></h:panelGroup>
		
		<t:panelGroup>
		   <t:panelGrid columns="2">
		   		<h:commandButton value="#{messages['create']}" styleClass="button" action="#{currencyRateBean.addAction}" actionListener="#{currencyRateBean.addActionEvent}"></h:commandButton>
			    <h:commandButton value="#{messages['back']}" styleClass="button" action="#{currencyRateBean.backToListAction}" immediate="true"></h:commandButton>
		   </t:panelGrid>
		</t:panelGroup>
	</t:panelGrid>

</rich:panel>
